<template>
  <div id="search_container">
    <el-input type="text" placeholder="请输入" :id="inputObj.inputId" v-model="inputObj.searchValue"></el-input>
    <button id="searchBtn" @click="search">搜索</button>
  </div>
</template>

<script>
import bus from "@/bus/bus";
export default {
  data() {
    return {
      inputObj: {
        searchValue: '',
        inputId: 'searchInput'
      },
    }
  },
  methods: {
    search() {
      bus.$emit('shareUserInput', this.inputObj)
    }
  },
  mounted() {
    this.search()
  }
}
</script>

<style scoped lang="less">
#search_container {
  display: flex;
  height: 100%;
  width: 100%;
  #searchBtn {
    width: 140px;
    height: 30px;
  }
  input {
    height: 30px;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 5px;
  }
}
</style>